package com.csun.cmny.provider.job.simple;

import com.csun.cmny.provider.model.dto.SendClockDto;
import com.csun.cmny.provider.service.DmcRpcService;
import com.csun.cmny.util.DateUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.paascloud.elastic.lite.annotation.ElasticJobConfig;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;
import java.util.Calendar;
import java.util.Date;

/**
 * @author : chisj
 * @date: 2020-03-02  22:11
 * @description: the class second refresh job
 *
 * 每秒执行一次
 *
 */
@Slf4j
//@ElasticJobConfig(cron = "0/1 * * * * ?")
public class SecondRefreshJob implements SimpleJob {

    @Resource
    private DmcRpcService dmcRpcService;

    /**
     * Execute.
     *
     * @param shardingContext the sharding context
     */
    @Override
    public void execute(final ShardingContext shardingContext) {

        Date date = new Date();

        String str = DateUtil.YYYY_MM_DD_MM_HH_SS.format(date);
        // String time = str.substring(11, 19);

        log.info("=====> chisj second refresh quartz = {}", str);

        // 定时刷新redis key
        // dmcRpcService.refreshRedisKey(str);
    }

}